typedef struct {
    int* arr;
    int size;
    int capacity;
}Arr;

typedef struct {
    Arr arr1;
} MyCircularQueue;


MyCircularQueue* myCircularQueueCreate(int k) {
    MyCircularQueue* obj = (MyCircularQueue*)malloc(sizeof(MyCircularQueue));
    obj->arr1.arr = (int*)malloc(k * sizeof(int));
    obj->arr1.size = 0;
    obj->arr1.capacity = k;
    return obj;
}

bool myCircularQueueEnQueue(MyCircularQueue* obj, int value) {
    if (obj->arr1.size == obj->arr1.capacity)
    {
        return false;
    }
    obj->arr1.arr[obj->arr1.size++] = value;
    return true;
}

bool myCircularQueueDeQueue(MyCircularQueue* obj) {
    if (obj->arr1.size == 0) {
        return false;
    }
    for (int i = 0; i < obj->arr1.size - 1; i++) {
        obj->arr1.arr[i] = obj->arr1.arr[i + 1];
    }
    obj->arr1.size--;
    return true;
}

int myCircularQueueFront(MyCircularQueue* obj) {
    if (obj->arr1.size == 0)
    {
        return -1;
    }
    else {
        return obj->arr1.arr[0];
    }
}

int myCircularQueueRear(MyCircularQueue* obj) {
    if (obj->arr1.size == 0)
    {
        return -1;
    }
    else {
        return obj->arr1.arr[obj->arr1.size - 1];
    }
}

bool myCircularQueueIsEmpty(MyCircularQueue* obj) {
    if (obj->arr1.size == 0)
    {
        return true;
    }
    else {
        return false;
    }
}

bool myCircularQueueIsFull(MyCircularQueue* obj) {
    if (obj->arr1.size == obj->arr1.capacity)
    {
        return true;
    }
    else {
        return false;
    }
}

void myCircularQueueFree(MyCircularQueue* obj) {
    free(&obj->arr1.arr);
    obj = NULL;
}

/**
 * Your MyCircularQueue struct will be instantiated and called as such:
 * MyCircularQueue* obj = myCircularQueueCreate(k);
 * bool param_1 = myCircularQueueEnQueue(obj, value);

 * bool param_2 = myCircularQueueDeQueue(obj);

 * int param_3 = myCircularQueueFront(obj);

 * int param_4 = myCircularQueueRear(obj);

 * bool param_5 = myCircularQueueIsEmpty(obj);

 * bool param_6 = myCircularQueueIsFull(obj);

 * myCircularQueueFree(obj);
*/